package _base0to1;

import java.util.Arrays;

/**
 * 1502. 判断能否形成等差数列
 */
public class No1502 {
    public boolean canMakeArithmeticProgression(int[] arr) {
        Arrays.sort(arr);
        int differ = arr[0] - arr[1];
        for (int i = 1; i < arr.length - 1; i++) {
            if (arr[i] - arr[i + 1] != differ) return false;
        }
        return true;
    }
}
